package main

import "fmt"

func sum (n int) uint64{
	/*
	对于一个数n，求n的阶乘之和，即： 1！ + 2！ + 3！+…n!
	 */
	var s uint64 = 1//每次阶乘
	var sum uint64 = 0
	for i := 1; i <= n; i++ {
		s = s * uint64(i)
		fmt.Printf("%d!=%v \n", i, s)
		sum += s
	}
	return sum
}

func main() {
	var n int
	fmt.Scanf("%d", &n)
	n = 10
	s := sum(n)
	fmt.Println(s)
}